<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-minimal.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"www.kiilin.com","root":"/","scheme":"Mist","version":"7.8.0","exturl":true,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":true,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":true,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":"valine","storage":true,"lazyload":false,"nav":null,"activeClass":"valine"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="很早就想搭建一个属于自己的博客，也试过博客园、CSDN的博客，但是总感觉不是真正属于自己的博客，而且看到广告很烦。偶然发现一篇Hexo+github搭建博客的教程，就开始了尝试。本篇为从零搭建博客的教程，其他功能等待后续文章。">
<meta property="og:type" content="article">
<meta property="og:title" content="CentOS下搭建Hexo + github 博客 多端同步 后台管理(未完成)">
<meta property="og:url" content="https://www.kiilin.com/blog/hexo_install.html">
<meta property="og:site_name" content="云声の博客">
<meta property="og:description" content="很早就想搭建一个属于自己的博客，也试过博客园、CSDN的博客，但是总感觉不是真正属于自己的博客，而且看到广告很烦。偶然发现一篇Hexo+github搭建博客的教程，就开始了尝试。本篇为从零搭建博客的教程，其他功能等待后续文章。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/github-page-index.jpg">
<meta property="og:image" content="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/new%20repository.jpg">
<meta property="og:image" content="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/new%20repository%20info.jpg">
<meta property="og:image" content="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/setting.jpg">
<meta property="og:image" content="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/SSH.jpg">
<meta property="og:image" content="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/key.jpg">
<meta property="og:image" content="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/new%20key.jpg">
<meta property="article:published_time" content="2018-03-01T11:44:00.000Z">
<meta property="article:modified_time" content="2020-12-31T02:06:41.546Z">
<meta property="article:author" content="云声">
<meta property="article:tag" content="centos">
<meta property="article:tag" content="hexo">
<meta property="article:tag" content="github">
<meta property="article:tag" content="hexo-admin">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/github-page-index.jpg">

<link rel="canonical" href="https://www.kiilin.com/blog/hexo_install.html">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>CentOS下搭建Hexo + github 博客 多端同步 后台管理(未完成) | 云声の博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xm" title="云声の博客" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">云声の博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">云声的小白之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="archive fa-fw"></i>归档<span class="badge">5</span></a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="tags fa-fw"></i>标签<span class="badge">16</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="th fa-fw"></i>分类<span class="badge">4</span></a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

  <span class="exturl github-corner" data-url="aHR0cHM6Ly9naXRodWIuY29tL2trd3dhbmc=" title="Follow me on GitHub" aria-label="Follow me on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></span>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://www.kiilin.com/blog/hexo_install.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://wagk.oss-cn-huhehaote.aliyuncs.com/photo.jpeg">
      <meta itemprop="name" content="云声">
      <meta itemprop="description" content="记录学习的技能和遇到的问题">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="云声の博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          CentOS下搭建Hexo + github 博客 多端同步 后台管理(未完成)
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2018-03-01 19:44:00" itemprop="dateCreated datePublished" datetime="2018-03-01T19:44:00+08:00">2018-03-01</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-12-31 10:06:41" itemprop="dateModified" datetime="2020-12-31T10:06:41+08:00">2020-12-31</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%AE%89%E8%A3%85/" itemprop="url" rel="index"><span itemprop="name">安装</span></a>
                </span>
            </span>

          
            <span id="/blog/hexo_install.html" class="post-meta-item leancloud_visitors" data-flag-title="CentOS下搭建Hexo + github 博客 多端同步 后台管理(未完成)" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/blog/hexo_install.html#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/blog/hexo_install.html" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>6.6k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>6 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>很早就想搭建一个属于自己的博客，也试过博客园、CSDN的博客，但是总感觉不是真正属于自己的博客，而且看到广告很烦。偶然发现一篇Hexo+github搭建博客的教程，就开始了尝试。<br>本篇为从零搭建博客的教程，其他功能等待后续文章。</p>
<a id="more"></a>

<hr>
<h2 id="一、环境依赖"><a href="#一、环境依赖" class="headerlink" title="一、环境依赖"></a>一、环境依赖</h2><h5 id="首先你需要一台可以连接外网的linux主机（本文以阿里云ESC服务器为例，学生认证后购买有优惠），服务器相关配置相关内容不再赘述"><a href="#首先你需要一台可以连接外网的linux主机（本文以阿里云ESC服务器为例，学生认证后购买有优惠），服务器相关配置相关内容不再赘述" class="headerlink" title="首先你需要一台可以连接外网的linux主机（本文以阿里云ESC服务器为例，学生认证后购买有优惠），服务器相关配置相关内容不再赘述"></a>首先你需要一台可以连接外网的linux主机（本文以<span class="exturl" data-url="aHR0cHM6Ly93d3cuYWxpeXVuLmNvbS9wcm9kdWN0L2Vjcz9zcG09NTE3Ni44MTQyMDI5LjM4ODI2MS4yNDkuNWNlNzc2ZjQ2eTZjRHQ=">阿里云ESC服务器<i class="fa fa-external-link-alt"></i></span>为例，学生认证后购买有优惠），服务器相关配置相关内容不再赘述</h5><h5 id="服务器环境及版本"><a href="#服务器环境及版本" class="headerlink" title="服务器环境及版本"></a>服务器环境及版本</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">node····8.9.3</span><br><span class="line">git·····1.8.3.1</span><br><span class="line">hexo····3.6.0</span><br><span class="line">java····1.8.0_161 # 使用其他服务器中间件时不需要</span><br><span class="line">tomcat··9.0.5 # 使用其他服务器中间件时不需要</span><br><span class="line">hexo-admin # hexo博客管理工具</span><br></pre></td></tr></table></figure>
<hr>
<h2 id="二、环境配置"><a href="#二、环境配置" class="headerlink" title="二、环境配置"></a>二、环境配置</h2><p>本文所有安装路径在<code>/opt</code>目录结构下，所有目录结构仅供参考</p>
<h4 id="安装java，tomcat"><a href="#安装java，tomcat" class="headerlink" title="安装java，tomcat"></a>安装java，tomcat</h4><h5 id="也可用其他服务器中间件，在此不做说明"><a href="#也可用其他服务器中间件，在此不做说明" class="headerlink" title="也可用其他服务器中间件，在此不做说明"></a>也可用其他服务器中间件，在此不做说明</h5><h4 id="安装node-js"><a href="#安装node-js" class="headerlink" title="安装node.js"></a>安装node.js</h4><ul>
<li><h5 id="下载"><a href="#下载" class="headerlink" title="下载"></a>下载</h5>找到<span class="exturl" data-url="aHR0cDovL25vZGVqcy5jbi8=">最新的下载地址<i class="fa fa-external-link-alt"></i></span>，用wget命令下载到本地<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">cd /opt</span><br><span class="line">mkdir node</span><br><span class="line">cd node</span><br><span class="line">wget http://cdn.npm.taobao.org/dist/node/v8.9.3/node-v8.9.3-linux-x86.tar.gz</span><br></pre></td></tr></table></figure></li>
<li><h5 id="解压文件"><a href="#解压文件" class="headerlink" title="解压文件"></a>解压文件</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tar -zxvf node-v8.9.3-linux-x86.tar.gz</span><br></pre></td></tr></table></figure></li>
<li><h5 id="配置环境变量"><a href="#配置环境变量" class="headerlink" title="配置环境变量"></a>配置环境变量</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash"> 编辑 /etc/profile (使用vim)</span></span><br><span class="line">vim /etc/profile</span><br><span class="line"><span class="meta">#</span><span class="bash"> 按A插入编辑 vim编辑不在此赘述</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> 在底部添加 PATH 变量</span></span><br><span class="line">export NODE_HOME=/opt/node/node-v8.9.3-linux-x64</span><br><span class="line">export PATH=$PATH:$NODE_HOME/bin</span><br><span class="line"><span class="meta">#</span><span class="bash"> 保存退出，先按esc键，再输入</span></span><br><span class="line">:wq!</span><br><span class="line"><span class="meta">#</span><span class="bash"> 最后保存并使其生效即可</span></span><br><span class="line">source /etc/profile</span><br></pre></td></tr></table></figure></li>
<li><h5 id="检查环境"><a href="#检查环境" class="headerlink" title="检查环境"></a>检查环境</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash"> 检查node.js版本</span></span><br><span class="line">node -v</span><br></pre></td></tr></table></figure>
  输出如下内容即表示安装成功  <figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">v8.9.3 # 安装的版本号</span><br></pre></td></tr></table></figure>
<h4 id="安装git"><a href="#安装git" class="headerlink" title="安装git"></a>安装git</h4></li>
<li><h5 id="安装流程"><a href="#安装流程" class="headerlink" title="安装流程"></a>安装流程</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install git</span><br></pre></td></tr></table></figure></li>
<li><h5 id="检查环境-1"><a href="#检查环境-1" class="headerlink" title="检查环境"></a>检查环境</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash"> 检查git.js版本</span></span><br><span class="line">git --version</span><br></pre></td></tr></table></figure>
  输出如下内容即表示安装成功  <figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git version 1.8.3.1 # 安装的版本号</span><br></pre></td></tr></table></figure>

</li>
</ul>
<h4 id="配置github-page"><a href="#配置github-page" class="headerlink" title="配置github page"></a>配置github page</h4><ul>
<li><h5 id="Github的优点"><a href="#Github的优点" class="headerlink" title="Github的优点"></a>Github的优点</h5><p>GitHub是基于git实现的代码托管。git可能是目前最好用的版本控制系统了，非常受欢迎。<br>GitHub可以免费使用，并且快速稳定。<br>Github上面的世界很精彩，用久了你的眼界会开阔很多。</p>
</li>
<li><h5 id="什么是Github-Pages"><a href="#什么是Github-Pages" class="headerlink" title="什么是Github Pages?"></a>什么是Github Pages?</h5><p>Github Pages可以被认为是用户编写的、托管在github上的静态网页。<span class="exturl" data-url="aHR0cHM6Ly9wYWdlcy5naXRodWIuY29tLw==">GitHub Pages<i class="fa fa-external-link-alt"></i></span> 本用于介绍托管在GitHub的项目，不过，由于他的空间免费稳定，用来做搭建一个博客再好不过了。<br><a target="_blank" rel="noopener" href="https://pages.github.com/" title="github page首页"><img src="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/github-page-index.jpg" alt="github page首页" title="github page首页"></a></p>
</li>
<li><h5 id="为什么要使用Github-Pages"><a href="#为什么要使用Github-Pages" class="headerlink" title="为什么要使用Github Pages"></a>为什么要使用Github Pages</h5><p>可以绑定你的域名(但暂时貌似只能绑定一个)。<br>简单快捷，使用Github Pages可以为你提供一个免费的服务器，免去了自己搭建服务器和写数据库的麻烦.</p>
</li>
<li><h5 id="注册GitHub账号"><a href="#注册GitHub账号" class="headerlink" title="注册GitHub账号"></a>注册GitHub账号</h5><p>在创建博客之前，当然必须有GitHub的帐号，该帐号将用来创建项目，默认的域名username.github.com/projectName中的username也要用到这个帐号。</p>
<blockquote>
<p>注意：下面涉及到的一些命令凡是更用户名和项目名有关的一律会用这里的username和projectName代替，注意替换<br>访问：<span class="exturl" data-url="aHR0cDovL3d3dy5naXRodWIuY29tLw==">http://www.github.com/<i class="fa fa-external-link-alt"></i></span><br>注册你的username和邮箱，邮箱十分重要，GitHub上很多通知都是通过邮箱的。比如你的主页上传并构建成功会通过邮箱通知，更重要的是，如果构建失败的话也会在邮件中说明原因。</p>
</blockquote>
</li>
<li><h5 id="创建项目仓库"><a href="#创建项目仓库" class="headerlink" title="创建项目仓库"></a>创建项目仓库</h5><p>在创建博客之前，还需要用已有的帐号创建一个项目，上面那个链接的projectName将是这里即将创建的项目名称。在Git中，项目被称为仓库(Repository)，仓库顾名思义，当然可以包含代码或者非代码。将来我们的网页或者模板实际上都是保存在这个仓库中的。</p>
</li>
</ul>
<ol>
<li>登录后，点击头像旁边+号选择<code>new repository</code>创建仓库，如下图<br><img src="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/new%20repository.jpg" alt="新建github仓库入口" title="新建github仓库入口"></li>
<li>填写仓库信息，如下图<br><img src="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/new%20repository%20info.jpg" alt="填写github page信息" title="填写github page信息"><blockquote>
<ol>
<li>每个帐号只能有一个仓库来存放个人主页，而且仓库的名字必须是<code>username/username.github.io</code>这是特殊的命名约定。你可以通过<span class="exturl" data-url="aHR0cHM6Ly91c2VybmFtZS5naXRodWIuaW8v">https://username.github.io<i class="fa fa-external-link-alt"></i></span> 来访问你的个人主页。</li>
<li>上图<code>Repository name</code>必须为<code>username.github.io</code>其中<code>username</code>为你的用户名，和前面<code>Owner</code>相同；<code>Description</code> 为仓库描述，根据需要填写</li>
<li>创建了仓库后，我们就需要管理它，无论是管理本地仓库还是远程仓库都需要Git客户端；Git客户端实际上十分强大，它本身就可以offline的创建本地仓库，而本地仓库和远程仓库之间的同步也是通过Git客户端完成的。</li>
</ol>
</blockquote>
</li>
</ol>
<ul>
<li><h5 id="SSH配置"><a href="#SSH配置" class="headerlink" title="SSH配置"></a>SSH配置</h5>上传文件需要配置ssh key，不然无法上传。</li>
</ul>
<ol>
<li>首先先检查一下本地是否已经存在ssh key,在Git Bash输入以下指令（任意位置点击鼠标右键），检查是否已经存在了SSH keys。<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ls -al ~/.ssh</span><br></pre></td></tr></table></figure></li>
<li>如果不存在就没有关系，如果存在的话，在保证没有其他人使用的情况下可以直接删除<code>.ssh</code>文件夹里面所有文件：<br>如果存在将显示为：<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">total 20</span><br><span class="line">drwx------  2 root root 4096 Mar  1 17:05 .</span><br><span class="line">dr-xr-x---. 8 root root 4096 Mar  2 10:28 ..</span><br><span class="line">-rw-------  1 root root    0 Mar  1 14:11 authorized_keys</span><br><span class="line">-rw-------  1 root root 1679 Mar  1 16:55 id_rsa</span><br><span class="line">-rw-r--r--  1 root root  397 Mar  1 16:55 id_rsa.pub</span><br><span class="line">-rw-r--r--  1 root root 1197 Mar  1 17:12 known_hosts</span><br></pre></td></tr></table></figure></li>
<li>设置name和emai<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.email &quot;you@example.com&quot;</span><br><span class="line">git config --global user.name &quot;Your Name&quot;</span><br></pre></td></tr></table></figure>
需要注意的是这里的name是随意的，邮箱是你的联系邮箱，与github上的邮箱没有什么联系（不过我都是同一个邮箱）。</li>
<li>生成ssh 密钥<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -t rsa -C &quot;username@domain.com&quot; # 邮箱就是你注册Github时候的邮箱</span><br></pre></td></tr></table></figure>
按三次回车键即可，如果设置了密码请记住。<br>这一步在~/.ssh/下生成了两个文件id_rsa 和 id_rsa.pub</li>
<li>获取Key<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cat ~/.ssh/id_rsa.pub</span><br></pre></td></tr></table></figure>
然后复制key</li>
<li>在Github上添加SSH密钥</li>
<li>点击头像选择下方Setting进入<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3NldHRpbmdzL3Byb2ZpbGU=">设置界面<i class="fa fa-external-link-alt"></i></span>，如下图<br><a target="_blank" rel="noopener" href="https://github.com/settings/profile" title="设置界面入口"><img src="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/setting.jpg" alt="设置界面入口" title="设置界面入口"></a><br>在左侧选择<code>SSH and GPG keys</code>，如下图<br><a target="_blank" rel="noopener" href="https://github.com/settings/keys" title="SSH key 入口"><img src="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/SSH.jpg" alt="SSH key 入口" title="SSH key 入口"></a><br>我这里已经填写了两组key，选择上方<code>New SSH key</code>新建 SSH key<br><a target="_blank" rel="noopener" href="https://github.com/settings/keys" title="SSH key 管理"><img src="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/key.jpg" alt="SSH key 管理" title="SSH key 管理"></a><br>粘贴刚刚复制的key到下方输入框，<code>Title</code>为key的自定义名称<br><a target="_blank" rel="noopener" href="https://github.com/settings/ssh/new" title="新建SSH key"><img src="http://wagk.oss-cn-huhehaote.aliyuncs.com/hexo/image/new%20key.jpg" alt="新建SSH key" title="新建SSH key"></a><br>之后保存完成</li>
</ol>
<h4 id="安装hexo"><a href="#安装hexo" class="headerlink" title="安装hexo"></a>安装hexo</h4><ul>
<li><h5 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">cd /opt</span><br><span class="line"><span class="meta">#</span><span class="bash"> 创建目录</span></span><br><span class="line">mkdir blog</span><br><span class="line"><span class="meta">#</span><span class="bash"> 安装 Hexo</span></span><br><span class="line">npm install -g hexo</span><br><span class="line"><span class="meta">#</span><span class="bash"> 初始化 Hexo</span></span><br><span class="line">hexo init blog</span><br></pre></td></tr></table></figure></li>
<li><h5 id="安装插件"><a href="#安装插件" class="headerlink" title="安装插件"></a>安装插件</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash"> 安装插件</span></span><br><span class="line">npm install</span><br><span class="line"><span class="meta">#</span><span class="bash"> 如果使用过程中确实某些插件的，可根据以下插件检查</span></span><br><span class="line">npm install hexo-generator-index --save</span><br><span class="line">npm install hexo-generator-archive --save</span><br><span class="line">npm install hexo-generator-category --save</span><br><span class="line">npm install hexo-generator-tag --save</span><br><span class="line">npm install hexo-server --save</span><br><span class="line">npm install hexo-deployer-git --save</span><br><span class="line">npm install hexo-deployer-heroku --save</span><br><span class="line">npm install hexo-deployer-rsync --save</span><br><span class="line">npm install hexo-deployer-openshift --save</span><br><span class="line">npm install hexo-renderer-marked --save</span><br><span class="line">npm install hexo-renderer-stylus --save</span><br><span class="line">npm install hexo-generator-feed --save</span><br><span class="line">npm install hexo-generator-sitemap --save</span><br></pre></td></tr></table></figure></li>
<li><h5 id="修改Hexo配置文件"><a href="#修改Hexo配置文件" class="headerlink" title="修改Hexo配置文件"></a>修改Hexo配置文件</h5><blockquote>
<p>配置文件路径： <code>./_config.yml</code> 以下为我的配置，仅供参考<br>提示：key对应没有值的时候，冒号后面一定要有空格！否则会报错<br>如: timezone:会报错，timezone: 则不会。</p>
</blockquote>
</li>
<li><h5 id="Hexo配置文件参考"><a href="#Hexo配置文件参考" class="headerlink" title="Hexo配置文件参考"></a>Hexo配置文件参考</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash"> Hexo Configuration Hexo配置文件</span></span><br><span class="line"><span class="meta">#</span><span class="bash"><span class="comment"># Docs: https://hexo.io/docs/configuration.html</span></span></span><br><span class="line"><span class="meta">#</span><span class="bash"><span class="comment"># Source: https://github.com/hexojs/hexo/</span></span></span><br><span class="line"><span class="meta">#</span><span class="bash"> 网站信息</span></span><br><span class="line"><span class="meta">#</span><span class="bash">标题</span></span><br><span class="line">title: 某某の博客</span><br><span class="line"><span class="meta">#</span><span class="bash">副标题</span></span><br><span class="line">subtitle: 博客的副标题</span><br><span class="line"><span class="meta">#</span><span class="bash">网站描述</span></span><br><span class="line">description: 博客的描述</span><br><span class="line"><span class="meta">#</span><span class="bash">作者昵称</span></span><br><span class="line">author: 作者</span><br><span class="line"><span class="meta">#</span><span class="bash">网站语言，默认英语，设置简体汉语</span></span><br><span class="line">language: zh-CN</span><br><span class="line"><span class="meta">#</span><span class="bash">时区，默认电脑时区</span></span><br><span class="line">timezone: Asia/Shanghai</span><br><span class="line"><span class="meta">#</span><span class="bash"> 网址设置</span></span><br><span class="line"><span class="meta">#</span><span class="bash">如果网站是放在子目录中，将url设置成<span class="string">&#x27;http://yoursite.com/child&#x27;</span>，将root设置成<span class="string">&#x27;/child/&#x27;</span></span></span><br><span class="line"><span class="meta">#</span><span class="bash"><span class="comment"># If your site is put in a subdirectory, set url as &#x27;http://yoursite.com/child&#x27; and root as &#x27;/child/&#x27;</span></span></span><br><span class="line"><span class="meta">#</span><span class="bash">网址</span></span><br><span class="line">url: http://www.domain.com</span><br><span class="line"><span class="meta">#</span><span class="bash">网站根目录。如果网站是放在子目录中，将root设置成<span class="string">&#x27;子目录名&#x27;</span></span></span><br><span class="line">root: /</span><br><span class="line"><span class="meta">#</span><span class="bash">文章链接地址格式 。即文章存放的目录。</span></span><br><span class="line">permalink: :year/:month/:day/:title/</span><br><span class="line">permalink_defaults:</span><br><span class="line"><span class="meta">#</span><span class="bash"> 目录设置</span></span><br><span class="line"><span class="meta">#</span><span class="bash">资源文件夹，放在里面的文件会上传到github中</span></span><br><span class="line">source_dir: source</span><br><span class="line"><span class="meta">#</span><span class="bash">公共文件夹，存放生成的静态文件</span></span><br><span class="line">public_dir: public</span><br><span class="line"><span class="meta">#</span><span class="bash">标签文件夹，默认是tags。实际存放在<span class="built_in">source</span>/tags中。</span></span><br><span class="line">tag_dir: tags</span><br><span class="line">rss_dir: rss</span><br><span class="line"><span class="meta">#</span><span class="bash">档案文件夹，默认是archives。</span></span><br><span class="line">archive_dir: archives</span><br><span class="line"><span class="meta">#</span><span class="bash">分类文件夹，默认是categories。实际存放在<span class="built_in">source</span>/categories中。</span></span><br><span class="line">category_dir: categories</span><br><span class="line"><span class="meta">#</span><span class="bash">代码文件夹，默认是downloads/code</span></span><br><span class="line">code_dir: downloads/code</span><br><span class="line"><span class="meta">#</span><span class="bash">国际化文件夹，默认跟language相同</span></span><br><span class="line">i18n_dir: :lang</span><br><span class="line"><span class="meta">#</span><span class="bash">不需要渲染的文件夹或文件夹,放在[]中</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> 这两个文件是百度和google的站长验证文件，不能渲染，否则会改变内容，不能验证过</span></span><br><span class="line">skip_render: [baidu_verify_R9MZjdMkXT.html, google0f8fac7da2b48ef8.html, README.md, 模板.md]</span><br><span class="line"><span class="meta">#</span><span class="bash"> 写作选项</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> 新建博文（帖子）的默认名称</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> File name of new posts</span></span><br><span class="line">new_post_name: :title.md</span><br><span class="line"><span class="meta">#</span><span class="bash">默认布局模板是post，而不是draft和page</span></span><br><span class="line">default_layout: post</span><br><span class="line"><span class="meta">#</span><span class="bash">是否将标题转换成标题形式（首字母大写）</span></span><br><span class="line">titlecase: false # Transform title into titlecase</span><br><span class="line"><span class="meta">#</span><span class="bash">在新标签页面中打开网页</span></span><br><span class="line">external_link: true # Open external links in new tab</span><br><span class="line">filename_case: 0</span><br><span class="line"><span class="meta">#</span><span class="bash">是否渲染草稿</span></span><br><span class="line">render_drafts: false</span><br><span class="line"><span class="meta">#</span><span class="bash">启动 Asset 文件夹</span></span><br><span class="line">post_asset_folder: false</span><br><span class="line"><span class="meta">#</span><span class="bash">把链接改为与根目录的相对位址</span></span><br><span class="line">relative_link: false</span><br><span class="line"><span class="meta">#</span><span class="bash">显示未来的文章</span></span><br><span class="line">future: true</span><br><span class="line"><span class="meta">#</span><span class="bash">代码块的设置</span></span><br><span class="line">highlight:</span><br><span class="line">  enable: true          #  使用代码高亮</span><br><span class="line">  line_number: true # 显示行号</span><br><span class="line">  auto_detect: true  # 自动检测语言</span><br><span class="line">  tab_replace:</span><br><span class="line"><span class="meta">#</span><span class="bash"> 分类和标签</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> 默认分类</span></span><br><span class="line">default_category: uncategorized</span><br><span class="line"><span class="meta">#</span><span class="bash">分类别名</span></span><br><span class="line">category_map:</span><br><span class="line"><span class="meta">#</span><span class="bash">标签别名</span></span><br><span class="line">tag_map:</span><br><span class="line"><span class="meta">#</span><span class="bash"> 日期和时间格式</span></span><br><span class="line"><span class="meta">#</span><span class="bash">Hexo 使用 Moment.js 来解析和显示时间。</span></span><br><span class="line"><span class="meta">#</span><span class="bash"><span class="comment"># You can customize the date format as defined in</span></span></span><br><span class="line"><span class="meta">#</span><span class="bash"><span class="comment"># http://momentjs.com/docs/#/displaying/format/</span></span></span><br><span class="line">date_format: YYYY-MM-DD</span><br><span class="line">time_format: HH:mm:ss</span><br><span class="line"><span class="meta">#</span><span class="bash"> 分页配置</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> ---------------下面选项需要对应插件的支持---------------</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> npm install hexo-generator-index --save</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> npm install hexo-generator-archive --save</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> npm install hexo-generator-category --save</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> npm install hexo-generator-tag --save</span></span><br><span class="line"><span class="meta">#</span><span class="bash"><span class="comment"># Set per_page to 0 to disable pagination</span></span></span><br><span class="line"><span class="meta">#</span><span class="bash">每页显示的文章量</span></span><br><span class="line"><span class="meta">#</span><span class="bash">per_page: 20</span></span><br><span class="line"><span class="meta">#</span><span class="bash">首页的分页设置</span></span><br><span class="line">index_generator:</span><br><span class="line">  per_page: 5</span><br><span class="line"><span class="meta">#</span><span class="bash">归档页的分页设置</span></span><br><span class="line">archive_generator:</span><br><span class="line">  per_page: 30</span><br><span class="line">  yearly: true</span><br><span class="line">  monthly: true</span><br><span class="line"><span class="meta">#</span><span class="bash">标签页的分页设置</span></span><br><span class="line">tag_generator:</span><br><span class="line">  per_page: 20</span><br><span class="line"><span class="meta">#</span><span class="bash">分页路径，在public中可以看到</span></span><br><span class="line"><span class="meta">#</span><span class="bash">pagination_dir: page</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> Extensions 拓展插件配置</span></span><br><span class="line"><span class="meta">#</span><span class="bash"><span class="comment"># Plugins: https://hexo.io/plugins/</span></span></span><br><span class="line">plugins:</span><br><span class="line">baidusitemap:</span><br><span class="line">  path: baidusitemap.xml</span><br><span class="line"><span class="meta">#</span><span class="bash"> 配置RSS</span></span><br><span class="line">feed:</span><br><span class="line"><span class="meta">  #</span><span class="bash">feed 类型 (atom/rss2)</span></span><br><span class="line">  type: atom</span><br><span class="line"><span class="meta">  #</span><span class="bash">rss 路径</span></span><br><span class="line">  path: atom.xm</span><br><span class="line"><span class="meta">  #</span><span class="bash">在 rss 中最多生成的文章数(0显示所有)</span></span><br><span class="line">  limit: 0</span><br><span class="line"><span class="meta">#</span><span class="bash"> 自定义站点内容搜索</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> 需要先安装插件：</span></span><br><span class="line"><span class="meta">#</span><span class="bash"> npm install hexo-generator-search --save</span></span><br><span class="line">search:</span><br><span class="line">  path: search.xml</span><br><span class="line"><span class="meta">  #</span><span class="bash"> 如只想索引文章，可设置为post</span></span><br><span class="line">  field: all</span><br><span class="line"><span class="meta">#</span><span class="bash"> 主题配置</span></span><br><span class="line"><span class="meta">#</span><span class="bash"><span class="comment"># Themes: https://hexo.io/themes/</span></span></span><br><span class="line"><span class="meta">#</span><span class="bash">theme: <span class="literal">false</span> <span class="comment">#禁用主题</span></span></span><br><span class="line"><span class="meta">#</span><span class="bash">theme: landscape</span></span><br><span class="line">theme: next</span><br><span class="line"><span class="meta">#</span><span class="bash"> 部署配置</span></span><br><span class="line"><span class="meta">#</span><span class="bash"><span class="comment"># Docs: https://hexo.io/docs/deployment.html</span></span></span><br><span class="line">deploy:</span><br><span class="line">  type: git</span><br><span class="line">  repository: git@github.com:name/name.github.io.git # 该配置后续说明</span><br><span class="line">  branch: master</span><br></pre></td></tr></table></figure>
<p><b style="color: red; font-size: 20px;">1111</b></p>
</li>
</ul>
<p>本文参考：<br>1.<span class="exturl" data-url="aHR0cHM6Ly93d3cuamlhbnNodS5jb20vcC8wODIzZTM4N2MwMTk=">https://www.jianshu.com/p/0823e387c019<i class="fa fa-external-link-alt"></i></span></p>

    </div>

    
    
    
        <div class="reward-container">
  <div>支持一下，走一个！</div>
  <button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/images/wechatpay.jpeg" alt="云声 微信支付">
        <p>微信支付</p>
      </div>
      
      <div style="display: inline-block;">
        <img src="/images/alipay.jpeg" alt="云声 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>


      <footer class="post-footer">
          
          <div class="post-tags">
              <a href="/tags/centos/" rel="tag"><i class="fa fa-tag"></i> centos</a>
              <a href="/tags/hexo/" rel="tag"><i class="fa fa-tag"></i> hexo</a>
              <a href="/tags/github/" rel="tag"><i class="fa fa-tag"></i> github</a>
              <a href="/tags/hexo-admin/" rel="tag"><i class="fa fa-tag"></i> hexo-admin</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item"></div>
      <div class="post-nav-item">
    <a href="/blog/template.html" rel="next" title="jquery 自定义模板（jquery-template）">
      jquery 自定义模板（jquery-template） <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%80%E3%80%81%E7%8E%AF%E5%A2%83%E4%BE%9D%E8%B5%96"><span class="nav-number">1.</span> <span class="nav-text">一、环境依赖</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E9%A6%96%E5%85%88%E4%BD%A0%E9%9C%80%E8%A6%81%E4%B8%80%E5%8F%B0%E5%8F%AF%E4%BB%A5%E8%BF%9E%E6%8E%A5%E5%A4%96%E7%BD%91%E7%9A%84linux%E4%B8%BB%E6%9C%BA%EF%BC%88%E6%9C%AC%E6%96%87%E4%BB%A5%E9%98%BF%E9%87%8C%E4%BA%91ESC%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%BA%E4%BE%8B%EF%BC%8C%E5%AD%A6%E7%94%9F%E8%AE%A4%E8%AF%81%E5%90%8E%E8%B4%AD%E4%B9%B0%E6%9C%89%E4%BC%98%E6%83%A0%EF%BC%89%EF%BC%8C%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9B%B8%E5%85%B3%E9%85%8D%E7%BD%AE%E7%9B%B8%E5%85%B3%E5%86%85%E5%AE%B9%E4%B8%8D%E5%86%8D%E8%B5%98%E8%BF%B0"><span class="nav-number">1.0.0.1.</span> <span class="nav-text">首先你需要一台可以连接外网的linux主机（本文以阿里云ESC服务器为例，学生认证后购买有优惠），服务器相关配置相关内容不再赘述</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%8E%AF%E5%A2%83%E5%8F%8A%E7%89%88%E6%9C%AC"><span class="nav-number">1.0.0.2.</span> <span class="nav-text">服务器环境及版本</span></a></li></ol></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE"><span class="nav-number">2.</span> <span class="nav-text">二、环境配置</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%AE%89%E8%A3%85java%EF%BC%8Ctomcat"><span class="nav-number">2.0.1.</span> <span class="nav-text">安装java，tomcat</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E4%B9%9F%E5%8F%AF%E7%94%A8%E5%85%B6%E4%BB%96%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%AD%E9%97%B4%E4%BB%B6%EF%BC%8C%E5%9C%A8%E6%AD%A4%E4%B8%8D%E5%81%9A%E8%AF%B4%E6%98%8E"><span class="nav-number">2.0.1.1.</span> <span class="nav-text">也可用其他服务器中间件，在此不做说明</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%AE%89%E8%A3%85node-js"><span class="nav-number">2.0.2.</span> <span class="nav-text">安装node.js</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E4%B8%8B%E8%BD%BD"><span class="nav-number">2.0.2.1.</span> <span class="nav-text">下载</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E8%A7%A3%E5%8E%8B%E6%96%87%E4%BB%B6"><span class="nav-number">2.0.2.2.</span> <span class="nav-text">解压文件</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="nav-number">2.0.2.3.</span> <span class="nav-text">配置环境变量</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E6%A3%80%E6%9F%A5%E7%8E%AF%E5%A2%83"><span class="nav-number">2.0.2.4.</span> <span class="nav-text">检查环境</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%AE%89%E8%A3%85git"><span class="nav-number">2.0.3.</span> <span class="nav-text">安装git</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E5%AE%89%E8%A3%85%E6%B5%81%E7%A8%8B"><span class="nav-number">2.0.3.1.</span> <span class="nav-text">安装流程</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E6%A3%80%E6%9F%A5%E7%8E%AF%E5%A2%83-1"><span class="nav-number">2.0.3.2.</span> <span class="nav-text">检查环境</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E9%85%8D%E7%BD%AEgithub-page"><span class="nav-number">2.0.4.</span> <span class="nav-text">配置github page</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#Github%E7%9A%84%E4%BC%98%E7%82%B9"><span class="nav-number">2.0.4.1.</span> <span class="nav-text">Github的优点</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E4%BB%80%E4%B9%88%E6%98%AFGithub-Pages"><span class="nav-number">2.0.4.2.</span> <span class="nav-text">什么是Github Pages?</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A6%81%E4%BD%BF%E7%94%A8Github-Pages"><span class="nav-number">2.0.4.3.</span> <span class="nav-text">为什么要使用Github Pages</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E6%B3%A8%E5%86%8CGitHub%E8%B4%A6%E5%8F%B7"><span class="nav-number">2.0.4.4.</span> <span class="nav-text">注册GitHub账号</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E5%88%9B%E5%BB%BA%E9%A1%B9%E7%9B%AE%E4%BB%93%E5%BA%93"><span class="nav-number">2.0.4.5.</span> <span class="nav-text">创建项目仓库</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#SSH%E9%85%8D%E7%BD%AE"><span class="nav-number">2.0.4.6.</span> <span class="nav-text">SSH配置</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%AE%89%E8%A3%85hexo"><span class="nav-number">2.0.5.</span> <span class="nav-text">安装hexo</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E5%AE%89%E8%A3%85"><span class="nav-number">2.0.5.1.</span> <span class="nav-text">安装</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E5%AE%89%E8%A3%85%E6%8F%92%E4%BB%B6"><span class="nav-number">2.0.5.2.</span> <span class="nav-text">安装插件</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E4%BF%AE%E6%94%B9Hexo%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="nav-number">2.0.5.3.</span> <span class="nav-text">修改Hexo配置文件</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Hexo%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E5%8F%82%E8%80%83"><span class="nav-number">2.0.5.4.</span> <span class="nav-text">Hexo配置文件参考</span></a></li></ol></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="云声"
      src="https://wagk.oss-cn-huhehaote.aliyuncs.com/photo.jpeg">
  <p class="site-author-name" itemprop="name">云声</p>
  <div class="site-description" itemprop="description">记录学习的技能和遇到的问题</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">5</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">16</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2trd3dhbmc=" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;kkwwang"><i class="github-alt fa-fw"></i>GitHub</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9naXRlZS5jb20va2lpbGlu" title="Gitee → https:&#x2F;&#x2F;gitee.com&#x2F;kiilin"><i class="git fa-fw"></i>Gitee</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="bWFpbHRvOndhbmdrYWlAa2lpbGluLmNvbQ==" title="E-Mail → mailto:wangkai@kiilin.com"><i class="envelope fa-fw"></i>E-Mail</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cDovL3dwYS5xcS5jb20vbXNncmQ/dj0zJnVpbj03NzMyNzk1OTUmc2l0ZT1xcSZtZW51PXllcw==" title="QQ → http:&#x2F;&#x2F;wpa.qq.com&#x2F;msgrd?v&#x3D;3&amp;uin&#x3D;773279595&amp;site&#x3D;qq&amp;menu&#x3D;yes"><i class="qq fa-fw"></i>QQ</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9tZS5jc2RuLm5ldC93NzczMjc5NTk1" title="CSDN → https:&#x2F;&#x2F;me.csdn.net&#x2F;w773279595"><i class="copyright fa-fw"></i>CSDN</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cDovL3d3dy5qcTIyLmNvbS9tZW0zOTI5MjQ=" title="jq22 → http:&#x2F;&#x2F;www.jq22.com&#x2F;mem392924"><i class="usd fa-fw"></i>jq22</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly93d3cuamlhbnNodS5jb20vdS9kYjg4NTU4MjNkZWE=" title="简书 → https:&#x2F;&#x2F;www.jianshu.com&#x2F;u&#x2F;db8855823dea"><i class="heartbeat fa-fw"></i>简书</span>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title"><i class="link fa-fw"></i>
      友情连接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://www.kiilin.com/" title="https:&#x2F;&#x2F;www.kiilin.com">云声の博客</a>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly93d3cuYmFpZHUuY29t" title="https:&#x2F;&#x2F;www.baidu.com">百度</span>
        </li>
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        
  <div class="beian"><span class="exturl" data-url="aHR0cHM6Ly9iZWlhbi5taWl0Lmdvdi5jbg==">苏ICP备18007508号-1 </span><span class="exturl" data-url="aHR0cDovL3d3dy5iZWlhbi5nb3YuY24vcG9ydGFsL3JlZ2lzdGVyU3lzdGVtSW5mbz9yZWNvcmRjb2RlPWVkaXQmYWRtaW4=">&nbsp;|&nbsp; <a target="_blank" rel="external nofollow" href="http://markdown.xiaoshujiang.com">编辑器</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a target="_blank" rel="external nofollow" href="http://localhost:4000/admin">admin</a> </span>
  </div>

<div class="copyright">
  
  &copy; 2016 – 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder"><a target="_blank" rel="external nofollow" href="https://github.com/kkwwang">云声</a></span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
      <span class="post-meta-item-text">站点总字数：</span>
    <span title="站点总字数">43k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">39 分钟</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  
  <script color='0,0,255' opacity='0.5' zIndex='-1' count='99' src="/lib/canvas-nest/canvas-nest.min.js"></script>
  <script size="300" alpha="0.6" zIndex="-1" src="/lib/canvas-ribbon/canvas-ribbon.js"></script>
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/medium-zoom@1/dist/medium-zoom.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>

<script src="/js/bookmark.js"></script>




  
  <script>
    (function(){
      var canonicalURL, curProtocol;
      //Get the <link> tag
      var x=document.getElementsByTagName("link");
		//Find the last canonical URL
		if(x.length > 0){
			for (i=0;i<x.length;i++){
				if(x[i].rel.toLowerCase() == 'canonical' && x[i].href){
					canonicalURL=x[i].href;
				}
			}
		}
    //Get protocol
	    if (!canonicalURL){
	    	curProtocol = window.location.protocol.split(':')[0];
	    }
	    else{
	    	curProtocol = canonicalURL.split(':')[0];
	    }
      //Get current URL if the canonical URL does not exist
	    if (!canonicalURL) canonicalURL = window.location.href;
	    //Assign script content. Replace current URL with the canonical URL
      !function(){var e=/([http|https]:\/\/[a-zA-Z0-9\_\.]+\.baidu\.com)/gi,r=canonicalURL,t=document.referrer;if(!e.test(r)){var n=(String(curProtocol).toLowerCase() === 'https')?"https://sp0.baidu.com/9_Q4simg2RQJ8t7jm9iCKT-xh_/s.gif":"//api.share.baidu.com/s.gif";t?(n+="?r="+encodeURIComponent(document.referrer),r&&(n+="&l="+r)):r&&(n+="?l="+r);var i=new Image;i.src=n}}(window);})();
  </script>




  
<script src="/js/local-search.js"></script>









<script>
document.querySelectorAll('.pdfobject-container').forEach(element => {
  let url = element.dataset.target;
  let pdfOpenParams = {
    navpanes : 0,
    toolbar  : 0,
    statusbar: 0,
    pagemode : 'thumbs',
    view     : 'FitH'
  };
  let pdfOpenFragment = '#' + Object.entries(pdfOpenParams).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&');
  let fullURL = `/lib/pdf/web/viewer.html?file=${encodeURIComponent(url)}${pdfOpenFragment}`;

  if (NexT.utils.supportsPDFs()) {
    element.innerHTML = `<embed class="pdfobject" src="${url + pdfOpenFragment}" type="application/pdf" style="height: ${element.dataset.height};">`;
  } else {
    element.innerHTML = `<iframe src="${fullURL}" style="height: ${element.dataset.height};" frameborder="0"></iframe>`;
  }
});
</script>




  

  
  <script src="//cdn.jsdelivr.net/npm/quicklink@1/dist/quicklink.umd.js"></script>
  <script>
      window.addEventListener('load', () => {
      quicklink({
        timeout : 3000,
        priority: true,
        ignores : [uri => uri.includes('#'),uri => uri === 'https://www.kiilin.com/blog/hexo_install.html',]
      });
      });
  </script>


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('/lib/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : true,
      notify     : true,
      appId      : 'u9GHy2gIBw1lC5FJ2noLJzcG-gzGzoHsz',
      appKey     : 'oVGpN4Rd9begeCAdzi31th18',
      placeholder: "ヾﾉ≧∀≦)o 来呀！吐槽一番吧！",
      avatar     : '',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-cn' || 'zh-cn',
      path       : location.pathname,
      recordIP   : true,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
